<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<c:set value="${requestScope.response.data.list }" var="list"/>
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>下单 - 美妆产品销售系统</title>
		<%@ include file="/common/include/head_title.jsp"%>
	</head>
	<body>
		<jsp:include page="/IndexHeadServlet">
			<jsp:param value="header" name="method"/>
		</jsp:include>
		<section class="page-content-wrapper pt-100 pb-40">
			<!-- checkout-area start -->
		<div class="checkout-area">
			<div class="container">
				<div class="row">
					<form action="${rootPath }/head/OrdersHeadServlet?method=ordersInsertSubmit" method="post">
						<div class="col-lg-11 col-md-11">
							<div class="checkbox-form">
								<h3>收货人信息</h3>
								<div class="row">
									<div class="col-md-12">
										<div class="checkout-form-list">
											<label>姓名:</label>
											<input type="text" placeholder="姓名" name="name" value="${one.name }">
										</div>
									</div>
									<div class="col-md-12">
										<div class="checkout-form-list">
											<label>手机号:</label>
											<input type="text" placeholder="手机号" name="phone" value="${one.phone }">
										</div>
									</div>
									<div class="col-md-12">
										<div class="checkout-form-list">
											<label>地址:</label>
											<input type="text" placeholder="地址" name="address" value="${one.address }">
										</div>
									</div>
									<div class="col-md-12">
										<div class="checkout-form-list">
											<label>备注:</label>
											<input type="text" placeholder="备注:" name="note" value="${one.note }">
										</div>
									</div>
								</div>
								
								<h3>商品明细</h3>
								<div class="row">
								   <div class="col-md-12 col-sm-12 col-xs-12">
										<form action="#">				
											<div class="table-content table-responsive">
												<table>
													<thead>
														<tr>
															<th class="product-thumbnail">图片</th>
															<th class="product-name">名称</th>
															<th class="product-price">价格</th>
															<th class="product-quantity">数量</th>
															<th class="product-subtotal">总价格</th>
														</tr>
													</thead>
													<tbody>
														<c:set value="0" var="totalMoney"/>
														<c:set value="0" var="totalNum"/>
														<c:forEach items="${list }" var="listTemp" varStatus="stat">
															<tr>
																<td class="product-thumbnail">
																	<a href="${rootPath }/IndexHeadServlet?method=productInfo&id=${listTemp.prodId }" target="_blank" title="${listTemp.product.name }">
																		<c:choose>
																			<c:when test="${listTemp.product.pic != null && listTemp.product.pic != '' }">
																				<a href="${websiteFileUrl}${listTemp.product.pic }" target="_blank">
																					<img alt="" src="${websiteFileUrl}${listTemp.product.pic }" width="130" height="130">
																				</a>
																			</c:when>
																			<c:otherwise>
																				<img alt="" src="${rootPath }/img/no_pic.png" width="130" height="130">
																			</c:otherwise>
																		</c:choose>
																	</a>
																</td>
																<td class="product-name">
																	<a href="${rootPath }/IndexHeadServlet?method=productInfo&id=${listTemp.prodId }" target="_blank" title="${listTemp.product.name }">
																		${fn:substring(listTemp.product.name,0,subStrLen) }
																	</a>
																</td>
																<td class="product-price"><span class="amount">Y${listTemp.product.price }</span></td>
																<td class="product-quantity">${listTemp.num}</td>
																<td class="product-subtotal">${listTemp.product.price * listTemp.num }</td>
															</tr>
															<c:set value="${totalMoney + listTemp.product.price * listTemp.num }" var="totalMoney"/>
															<c:set value="${totalNum + listTemp.num }" var="totalNum"/>
														</c:forEach>
													</tbody>
												</table>
											</div>
											<div class="row">
												<div class="col-md-9 col-sm-7 col-xs-12">
													<div class="buttons-cart">
														<!-- <input type="submit" value="Update Cart"> -->
														<a href="${rootPath }/IndexHeadServlet?method=productList">继续购物</a>
													</div>
													<!-- <div class="coupon">
														<h3>Coupon</h3>
														<p>Enter your coupon code if you have one.</p>
														<input type="text" placeholder="Coupon code">
														<input type="submit" value="Apply Coupon">
													</div> -->
												</div>
												<div class="col-md-3 col-sm-5 col-xs-12">
													<div class="cart_totals">
														<h2>购物车总计:Y</h2>
														<table>
															<tbody>
																<tr class="cart-subtotal">
																	<th>总件数</th>
																	<td><span class="amount">${totalNum }</span></td>
																</tr>
																<tr class="order-total">
																	<th>总金额</th>
																	<td>
																		<strong><span class="amount">Y${totalMoney}</span></strong>
																	</td>
																</tr>											
															</tbody>
														</table>
													</div>
												</div>
												<div class="col-md-12">
													<div class="checkout-form-list">
														<input type="submit" value="下单" class="">
													</div>
												</div>
											</div>
										</form>	
									</div>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
		<!-- checkout-area end -->	
		</section>
		<%@ include file="/common/include/head_footer.jsp"%>
	</body>
</html>